package cn.com.w.bootdemo.controller;

import cn.com.w.bootdemo.annotation.CustomAnnotation;
import cn.com.w.bootdemo.entity.User;

import java.lang.reflect.Field;

public class TestController {

    public static void main(String[] args){

        /**
         * 获取类注解属性
         */
        Class<User> userClass = User.class;
        boolean annotationPresent = userClass.isAnnotationPresent(CustomAnnotation.class);
        if(annotationPresent){
            CustomAnnotation annotation = userClass.getAnnotation(CustomAnnotation.class);
            System.out.println(annotation.name());
            System.out.println(annotation.age());
        }






    }




}
